

package org.hive.hive;



import java.util.Collection;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;



public class TakePicture extends Activity implements OnClickListener{
	static Spinner spinner = null;
	static Spinner spinner1 = null;
	Button camera;
	
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.takepicture);
        spinner = (Spinner)this.findViewById(R.id.choosetrail);
        ArrayAdapter<CharSequence> tempAdapter = new ArrayAdapter<CharSequence>(this,android.R.layout.simple_spinner_item);
        tempAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(tempAdapter);
        Collection<String> albumnames = Global.albumlist.keySet();
        for (String tempValue : albumnames)
        {
        	tempAdapter.add(tempValue);
        }
        
        spinner1 = (Spinner)this.findViewById(R.id.choosecategory);
        camera=(Button)findViewById(R.id.camera);
        camera.setOnClickListener(this);
         	
	}

	@SuppressWarnings("unused")
	@Override
	public void onClick(View v) {
		
		// TODO Auto-generated method stub
		Global.curr_cat_id= spinner1.getSelectedItemPosition();
		Global.curr_album_name = spinner.getSelectedItem().toString();
		Intent i;
		i=new Intent(this,camera.class);
		startActivity(i);
		
	}
	
}
